Skip to content

Convert include queries back to snake case #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2016

Conversation

birkholz
Copy link
Contributor

@birkholz birkholz commented Jun 30, 2016

In parsers, we convert incoming keys to snake case (undoing whatever formatting was done during rendering). However, include parameters have to exactly match the fields of models/serializers.

This PR brings the same reversal behavior to include parameters as its done for attributes, etc.

Example:
?include[firstName]= == ?include[first_name]=

@jerel
Copy link
Member

jerel commented Jul 7, 2016

@scottfisk what are your thoughts on this? This one would be easy to merge but it looks like we also have related work at #204

@birkholz
Copy link
Contributor Author

birkholz commented Jul 7, 2016

@jerel I wrote this up before I saw #204

It seems that #204 is taking things further by also reversing pluralization and adding a setting to specify which format the keys should be reverted to. In my opinion, the effort of that PR should be expanded to the other areas that perform this behavior, namely parsing. This could then be considered a stopgap until that larger development is ready.

@scottfisk
Copy link
Contributor

@jerel This looks good to me. Agreed @birkholz I think we can pull this and #204 can continue the more in depth work based on this.

@jerel jerel merged commit c93dea1 into django-json-api:develop Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants